package com.gang.ssm.bos.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gang.ssm.bos.common.Page;
import com.gang.ssm.bos.system.bean.Workbill;
import com.gang.ssm.bos.system.mapper.WorkbillMapper;
import com.gang.ssm.bos.system.service.WorkbillService;

@Service
public class WorkbillServiceImpl implements WorkbillService{

	@Autowired
	private WorkbillMapper workmMapper;
	
	@Override
	public void pageQuery(Page<Workbill> pageBean) {
		int total = (int) workmMapper.countByExample(null);
		List<Workbill> workbills = workmMapper.findByLimit((pageBean.getPageNo() - 1) * 
				pageBean.getPageSize(),pageBean.getPageSize());
		
		pageBean.setTotalCount(total);
		pageBean.setResult(workbills);
	}

}
